Skip to content

Conversation

@DaleSeo
Copy link
Member

@DaleSeo DaleSeo commented Nov 20, 2025

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@github-actions github-actions bot added the rust label Nov 20, 2025
@DaleSeo DaleSeo changed the title linked-list-cycle [DaleSeo] WEEK 09 solutions Nov 20, 2025
@DaleSeo
Copy link
Member Author

DaleSeo commented Nov 20, 2025

@DaleStudy review

@dalestudy
Copy link
Contributor

dalestudy bot commented Nov 20, 2025

좋은 시도입니다! 이 구현은 중요한 부분인 Floyd의 사이클 감지 알고리즘을 잘 반영하고 있으며, 시간복잡도 O(n)과 상수 공간 O(1)를 명시하신 것도 매우 좋아요. 다만, 몇 가지 개선점을 제안드리고 싶습니다.

첫째, Option<Box<ListNode>>를 사용하는 방식은 안전하지만, ref를 활용해 포인터 비교를 하는 것이 더 간결하고 가독성이 높아질 수 있습니다. 현재는 mapas_ref를 사용하여 포인터 주소를 비교하는 방식인데, as_ref().unwrap() 대신 as_ref()를 유지하면서 ptr::eq를 사용하는 것도 고려해보세요. 이렇게 하면 더 명확하고 깔끔한 비교가 가능합니다.

둘째, 코드의 가독성을 위해 while 조건문과 내부의 조건 검사를 더 명확하게 정리할 수 있습니다. 예를 들어, fastfast.next가 모두 Some인 경우를 먼저 체크하는 구조는 적절하나, 변수 이름이나 주석을 통해 의도를 더 분명히 하면 좋겠습니다.

셋째, 이 알고리즘은 매우 표준적이고 효율적이지만, 만약 리스트가 매우 크거나 특정한 경우에 대비한 최적화가 필요하다면, 이 부분에 대해 언급하는 것도 좋을 것 같습니다.

마지막으로, 전체적으로 코드 스타일이 깔끔하고 이해하기 쉽습니다. // 주석으로 시간/공간 복잡도를 명확히 표기하신 것도 학습에 도움이 됩니다. 계속해서 이렇게 명료한 주석과 깔끔한 구현을 유지하시면 좋겠습니다!

추가로, 혹시 타입에 대해 더 명확하게 하고 싶거나, Rust의 Option을 활용한 더 우아한 방법을 찾고 계시다면 언제든 질문 주세요. 훌륭한 작업입니다!

@DaleSeo
Copy link
Member Author

DaleSeo commented Nov 20, 2025

@DaleStudy approve

@DaleSeo DaleSeo marked this pull request as ready for review November 20, 2025 01:41
Copy link
Contributor

@dalestudy dalestudy bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

승인되었습니다! 👍

@DaleSeo DaleSeo added this pull request to the merge queue Nov 20, 2025
@DaleSeo DaleSeo removed this pull request from the merge queue due to the queue being cleared Nov 20, 2025
@DaleSeo DaleSeo added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to invalid changes in the merge commit Nov 20, 2025
@DaleSeo DaleSeo added this pull request to the merge queue Nov 20, 2025
@DaleSeo DaleSeo removed this pull request from the merge queue due to a manual request Nov 20, 2025
@DaleSeo DaleSeo added this pull request to the merge queue Nov 20, 2025
@DaleSeo DaleSeo merged commit af17640 into DaleStudy:main Nov 20, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from Solving to Completed in 리트코드 스터디 6기 Nov 20, 2025
@DaleSeo DaleSeo moved this to Completed in 리트코드 스터디 5기 Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Completed

Development

Successfully merging this pull request may close these issues.

1 participant